from src.app import app, db, TestCase
import traceback

with app.app_context():
    try:
        print("尝试查询测试用例...")
        testcases = TestCase.query.filter_by(is_deleted=False).all()
        print(f"查询成功，找到 {len(testcases)} 个测试用例")
    except Exception as e:
        print(f"查询失败: {e}")
        print("详细错误信息:")
        traceback.print_exc()